]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
js: Use Gjs GTypeName computation for all classes
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Mon, 28 Oct 2019 18:35:33 +0000 (19:35 +0100)
committerFlorian Müllner <florian.muellner@gmail.com>
Tue, 29 Oct 2019 18:38:35 +0000 (18:38 +0000)
As per previous commit we can remove the explicit GTypeName definitions
and use gjs auto computation for all the GObject registered classes.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/790

26 files changed:
js/extensionPrefs/main.js
js/gdm/loginDialog.js
js/ui/altTab.js
js/ui/appDisplay.js
js/ui/lookingGlass.js
js/ui/messageList.js
js/ui/messageTray.js
js/ui/padOsd.js
js/ui/panelMenu.js
js/ui/screenshot.js
js/ui/shellMountOperation.js
js/ui/status/bluetooth.js
js/ui/status/brightness.js
js/ui/status/location.js
js/ui/status/network.js
js/ui/status/nightLight.js
js/ui/status/power.js
js/ui/status/remoteAccess.js
js/ui/status/rfkill.js
js/ui/status/screencast.js
js/ui/status/system.js
js/ui/status/thunderbolt.js
js/ui/status/volume.js
js/ui/userWidget.js
js/ui/workspace.js
js/ui/workspaceThumbnail.js

index 86afa34eee73e4ff761ef58cb3562eddcb859539..bd696523e8cc214571bf47a1ba2f518f30e5d0a9 100644 (file)
@@ -23,9 +23,8 @@ function stripPrefix(string, prefix) {
     return string;
 }
 
-var Application = GObject.registerClass({
-    GTypeName: 'ExtensionPrefs_Application'
-}, class Application extends Gtk.Application {
+var Application = GObject.registerClass(
+class Application extends Gtk.Application {
     _init() {
         GLib.set_prgname('gnome-shell-extension-prefs');
         super._init({
index 2c5834d442855e407783ec42453f521aaea49c45..1ad5c5dbcb6567514c1908b0b4f68d0af44c994b 100644 (file)
@@ -39,7 +39,6 @@ const _LOGO_ICON_HEIGHT = 48;
 const _MAX_BOTTOM_MENU_ITEMS = 5;
 
 var UserListItem = GObject.registerClass({
-    GTypeName: 'LoginDialog_UserListItem',
     Signals: { 'activate': {} }
 }, class UserListItem extends St.Button {
     _init(user) {
@@ -155,7 +154,6 @@ var UserListItem = GObject.registerClass({
 });
 
 var UserList = GObject.registerClass({
-    GTypeName: 'LoginDialog_UserList',
     Signals: {
         'activate': { param_types: [UserListItem.$gtype] },
         'item-added': { param_types: [UserListItem.$gtype] },
@@ -303,7 +301,6 @@ var UserList = GObject.registerClass({
 });
 
 var SessionMenuButton = GObject.registerClass({
-    GTypeName: 'LoginDialog_SessionMenuButton',
     Signals: { 'session-activated': { param_types: [GObject.TYPE_STRING] } }
 }, class SessionMenuButton extends St.Bin {
     _init() {
index 2500a45d0005db3695fbd5bd5a9ec93ae9701968..7200030356b6bff4f5de1e119b4c9efa05d64d91 100644 (file)
@@ -647,9 +647,8 @@ class WindowCyclerPopup extends CyclerPopup {
     }
 });
 
-var AppIcon = GObject.registerClass({
-    GTypeName: 'AltTab_AppIcon'
-}, class AppIcon extends St.BoxLayout {
+var AppIcon = GObject.registerClass(
+class AppIcon extends St.BoxLayout {
     _init(app) {
         super._init({ style_class: 'alt-tab-app',
                       vertical: true });
index 68dbb7f871abbaf835d10ca3f37e7ad4103817f5..6ff6be735e63c94d7c824bed7cb85fc06a881f3a 100644 (file)
@@ -1451,7 +1451,6 @@ class FolderView extends BaseAppView {
 });
 
 var FolderIcon = GObject.registerClass({
-    GTypeName: 'AppDisplay_FolderIcon',
     Signals: {
         'apps-changed': {},
         'name-changed': {},
@@ -1875,7 +1874,6 @@ var RenameFolderMenu = class RenameFolderMenu extends PopupMenu.PopupMenu {
 Signals.addSignalMethods(RenameFolderMenu.prototype);
 
 var AppFolderPopup = GObject.registerClass({
-    GTypeName: 'AppDisplay_AppFolderPopup',
     Signals: {
         'open-state-changed': { param_types: [GObject.TYPE_BOOLEAN] },
     }
@@ -2047,7 +2045,6 @@ var AppFolderPopup = GObject.registerClass({
 });
 
 var AppIcon = GObject.registerClass({
-    GTypeName: 'AppDisplay_AppIcon',
     Signals: {
         'menu-state-changed': { param_types: [GObject.TYPE_BOOLEAN] },
         'sync-tooltip': {},
index cadd4012df3dbb170dd99867d9d6862226712f6e..135fa5ec5daa35fa328ae033b288e619b9d43e77 100644 (file)
@@ -274,9 +274,8 @@ class ObjLink extends St.Button {
     }
 });
 
-var Result = GObject.registerClass({
-    GTypeName: 'LookingClass_Result'
-}, class Result extends St.BoxLayout {
+var Result = GObject.registerClass(
+class Result extends St.BoxLayout {
     _init(lookingGlass, command, o, index) {
         super._init({ vertical: true });
 
@@ -299,7 +298,6 @@ var Result = GObject.registerClass({
 });
 
 var WindowList = GObject.registerClass({
-    GTypeName: 'LookingClass_WindowList'
 }, class WindowList extends St.BoxLayout {
     _init(lookingGlass) {
         super._init({ name: 'Windows', vertical: true, style: 'spacing: 8px' });
@@ -632,7 +630,6 @@ var Inspector = GObject.registerClass({
 });
 
 var Extensions = GObject.registerClass({
-    GTypeName: 'LookingClass_Extensions'
 }, class Extensions extends St.BoxLayout {
     _init(lookingGlass) {
         super._init({ vertical: true, name: 'lookingGlassExtensions' });
index ba3b3fd2a96b775a880c44185748a3cd5a99d124..5cac1de75cf96779488d6bd6ac2589798dd0444b 100644 (file)
@@ -295,7 +295,6 @@ var LabelExpanderLayout = GObject.registerClass({
 
 
 var Message = GObject.registerClass({
-    GTypeName: 'MessageList_Message',
     Signals: {
         'close': {},
         'expanded': {},
index 0d86fc5035007dd016ed5408e5165e616c815c20..2ec8a14f422af53ca4e7df0a1a24bba6ea4fb224 100644 (file)
@@ -134,7 +134,6 @@ var FocusGrabber = class FocusGrabber {
 //
 // A notification without a policy object will inherit the default one.
 var NotificationPolicy = GObject.registerClass({
-    GTypeName: 'MessageTray_NotificationPolicy',
     Properties: {
         'enable': GObject.ParamSpec.boolean(
             'enable', 'enable', 'enable',
@@ -192,7 +191,6 @@ var NotificationPolicy = GObject.registerClass({
 });
 
 var NotificationGenericPolicy = GObject.registerClass({
-    GTypeName: 'MessageTray_NotificationGenericPolicy'
 }, class NotificationGenericPolicy extends NotificationPolicy {
     _init() {
         super._init();
@@ -223,7 +221,6 @@ var NotificationGenericPolicy = GObject.registerClass({
 });
 
 var NotificationApplicationPolicy = GObject.registerClass({
-    GTypeName: 'MessageTray_NotificationApplicationPolicy'
 }, class NotificationApplicationPolicy extends NotificationPolicy {
     _init(id) {
         super._init();
@@ -350,7 +347,6 @@ var NotificationApplicationPolicy = GObject.registerClass({
 //
 // [1] https://developer.gnome.org/notification-spec/#markup
 var Notification = GObject.registerClass({
-    GTypeName: 'MessageTray_Notification',
     Properties: {
         'acknowledged': GObject.ParamSpec.boolean(
             'acknowledged', 'acknowledged', 'acknowledged',
@@ -733,7 +729,6 @@ class SourceActorWithLabel extends SourceActor {
 });
 
 var Source = GObject.registerClass({
-    GTypeName: 'MessageTray_Source',
     Properties: {
         'count': GObject.ParamSpec.int(
             'count', 'count', 'count',
index edb4fbea0fead2928f9e79b5ee5adb79478819aa..1a09420a699dba14d5c45a226aa14da0e28831ac 100644 (file)
@@ -89,7 +89,6 @@ var PadChooser = GObject.registerClass({
 });
 
 var KeybindingEntry = GObject.registerClass({
-    GTypeName: 'PadOsd_KeybindingEntry',
     Signals: { 'keybinding-edited': {} }
 }, class KeybindingEntry extends St.Entry {
     _init() {
@@ -111,7 +110,6 @@ var KeybindingEntry = GObject.registerClass({
 });
 
 var ActionComboBox = GObject.registerClass({
-    GTypeName: 'PadOsd_ActionComboBox',
     Signals: { 'action-selected': { param_types: [GObject.TYPE_INT] } }
 }, class ActionComboBox extends St.Button {
     _init() {
@@ -194,7 +192,6 @@ var ActionComboBox = GObject.registerClass({
 });
 
 var ActionEditor = GObject.registerClass({
-    GTypeName: 'PadOsd_ActionEditor',
     Signals: { 'done': {} }
 }, class ActionEditor extends St.Widget {
     _init() {
index f98fd3b9ac896d79c205d6d3dfe62cc6685680b8..8c4c26423f489156964cf1d329030c30767db1f4 100644 (file)
@@ -195,9 +195,8 @@ var Button = GObject.registerClass({
  * of an icon and a menu section, which will be composed into the
  * aggregate menu.
  */
-var SystemIndicator = GObject.registerClass({
-    GTypeName: 'PanelMenu_SystemIndicator',
-}, class SystemIndicator extends St.BoxLayout {
+var SystemIndicator = GObject.registerClass(
+class SystemIndicator extends St.BoxLayout {
     _init() {
         super._init({
             style_class: 'panel-status-indicators-box',
index 8f2c297820b13690c12d914d6703237129e07c66..db9634364914d2fa4ff46807457d9f93bd23e6a6 100644 (file)
@@ -219,7 +219,6 @@ var ScreenshotService = class {
 };
 
 var SelectArea = GObject.registerClass({
-    GTypeName: 'Screenshot_SelectArea',
     Signals: { 'finished': { param_types: [Meta.Rectangle.$gtype] } }
 }, class SelectArea extends St.Widget {
     _init() {
@@ -317,7 +316,6 @@ var SelectArea = GObject.registerClass({
 });
 
 var PickPixel = GObject.registerClass({
-    GTypeName: 'Screenshot_PickPixel',
     Signals: { 'finished': { param_types: [Graphene.Point.$gtype] } }
 }, class PickPixel extends St.Widget {
     _init() {
index 966a92ec7315b1f1e2c810eb72f14d86c4fc3650..2a4de848860da78f71612f4a3aff056dd2d29a61 100644 (file)
@@ -44,7 +44,6 @@ function _setLabelsForMessage(content, message) {
 /* -------------------------------------------------------- */
 
 var ListItem = GObject.registerClass({
-    GTypeName: 'ShellMountOperation_ListItem',
     Signals: { 'activate': {} }
 }, class ListItem extends St.Button {
     _init(app) {
index 355312a70e8c9c76e382865b294e5decb6eb4ed4..957669dbb0f30d28b1e7e0f6f60e22e79a3d981a 100644 (file)
@@ -17,9 +17,8 @@ const RfkillManagerProxy = Gio.DBusProxy.makeProxyWrapper(RfkillManagerInterface
 
 const HAD_BLUETOOTH_DEVICES_SETUP = 'had-bluetooth-devices-setup';
 
-var Indicator = GObject.registerClass({
-    GTypeName: 'Bluetooth_Indicator'
-}, class Indicator extends PanelMenu.SystemIndicator {
+var Indicator = GObject.registerClass(
+class Indicator extends PanelMenu.SystemIndicator {
     _init() {
         super._init();
 
index f33d9dd8bd02ccc5ed1218f569abc072e9ad75b2..1abdab47e2c3ad55f2303004f1e031d8dc325906 100644 (file)
@@ -15,9 +15,8 @@ const OBJECT_PATH = '/org/gnome/SettingsDaemon/Power';
 const BrightnessInterface = loadInterfaceXML('org.gnome.SettingsDaemon.Power.Screen');
 const BrightnessProxy = Gio.DBusProxy.makeProxyWrapper(BrightnessInterface);
 
-var Indicator = GObject.registerClass({
-    GTypeName: 'Brightness_Indicator'
-}, class Indicator extends PanelMenu.SystemIndicator {
+var Indicator = GObject.registerClass(
+class Indicator extends PanelMenu.SystemIndicator {
     _init() {
         super._init();
         this._proxy = new BrightnessProxy(Gio.DBus.session, BUS_NAME, OBJECT_PATH,
index cbdab434c27cc8c7e619ad04a4a283ee26d8d57e..f719f7ef96d708580039a5725f8fca1ea595d0b4 100644 (file)
@@ -42,9 +42,8 @@ const GeoclueManager = Gio.DBusProxy.makeProxyWrapper(GeoclueIface);
 
 var AgentIface = loadInterfaceXML('org.freedesktop.GeoClue2.Agent');
 
-var Indicator = GObject.registerClass({
-    GTypeName: 'Location_Indicator'
-}, class Indicator extends PanelMenu.SystemIndicator {
+var Indicator = GObject.registerClass(
+class Indicator extends PanelMenu.SystemIndicator {
     _init() {
         super._init();
 
index 958473591a33180740595f71a643968d40970eb2..b18cef0a7cc04da75c277d45b35b5764e0dd09fd 100644 (file)
@@ -1591,9 +1591,8 @@ var DeviceCategory = class extends PopupMenu.PopupMenuSection {
     }
 };
 
-var NMApplet = GObject.registerClass({
-    GTypeName: 'Network_Indicator'
-}, class Indicator extends PanelMenu.SystemIndicator {
+var NMApplet = GObject.registerClass(
+class Indicator extends PanelMenu.SystemIndicator {
     _init() {
         super._init();
 
index 8277530c93b40e780a2ecf6314a59b5be6b78c0a..c595c3da02ab8de31ff70efee60426b3d77d52d7 100644 (file)
@@ -15,9 +15,8 @@ const OBJECT_PATH = '/org/gnome/SettingsDaemon/Color';
 const ColorInterface = loadInterfaceXML('org.gnome.SettingsDaemon.Color');
 const ColorProxy = Gio.DBusProxy.makeProxyWrapper(ColorInterface);
 
-var Indicator = GObject.registerClass({
-    GTypeName: 'NightLight_Indicator'
-}, class Indicator extends PanelMenu.SystemIndicator {
+var Indicator = GObject.registerClass(
+class Indicator extends PanelMenu.SystemIndicator {
     _init() {
         super._init();
 
index 8aefc5ad49783ad461abf63b3f55e38edf09c574..568cfa0355b7783caa662094815f4fc671350e3d 100644 (file)
@@ -17,9 +17,8 @@ const PowerManagerProxy = Gio.DBusProxy.makeProxyWrapper(DisplayDeviceInterface)
 
 const SHOW_BATTERY_PERCENTAGE       = 'show-battery-percentage';
 
-var Indicator = GObject.registerClass({
-    GTypeName: 'Power_Indicator'
-}, class Indicator extends PanelMenu.SystemIndicator {
+var Indicator = GObject.registerClass(
+class Indicator extends PanelMenu.SystemIndicator {
     _init() {
         super._init();
 
index eba686e900410bb82b9f0e968f4bba2929e9aeb7..0e13c04cf4e750c1499e370baac2edb1e05a5e3d 100644 (file)
@@ -6,9 +6,8 @@ const { GObject, Meta } = imports.gi;
 const PanelMenu = imports.ui.panelMenu;
 const PopupMenu = imports.ui.popupMenu;
 
-var RemoteAccessApplet = GObject.registerClass({
-    GTypeName: 'RemoteAccess_Indicator'
-}, class RemoteAccessApplet extends PanelMenu.SystemIndicator {
+var RemoteAccessApplet = GObject.registerClass(
+class RemoteAccessApplet extends PanelMenu.SystemIndicator {
     _init() {
         super._init();
 
index 7ba8220d4da1c278c30f11781064ca9a41062f28..88dc2696b06f1aa0f6fc00583df845204e5ff262 100644 (file)
@@ -61,9 +61,8 @@ function getRfkillManager() {
     return _manager;
 }
 
-var Indicator = GObject.registerClass({
-    GTypeName: 'Rfkill_Indicator'
-}, class Indicator extends PanelMenu.SystemIndicator {
+var Indicator = GObject.registerClass(
+class Indicator extends PanelMenu.SystemIndicator {
     _init() {
         super._init();
 
index 124236f09b8c8789bd88b7449dc3acddb669d52a..6bc162a8f2455bfb484d030c6b6d118b5a6c9b04 100644 (file)
@@ -6,9 +6,8 @@ const GObject = imports.gi.GObject;
 const Main = imports.ui.main;
 const PanelMenu = imports.ui.panelMenu;
 
-var Indicator = GObject.registerClass({
-    GTypeName: 'Screencast_Indicator'
-}, class Indicator extends PanelMenu.SystemIndicator {
+var Indicator = GObject.registerClass(
+class Indicator extends PanelMenu.SystemIndicator {
     _init() {
         super._init();
 
index 78079a8d58518ed9134e1fa4c76eff0f3297d8f2..a4e46ad9c38964a52b713f97ad6b127277d47098 100644 (file)
@@ -116,9 +116,8 @@ class AltSwitcher extends St.Bin {
     }
 });
 
-var Indicator = GObject.registerClass({
-    GTypeName: 'System_Indicator'
-}, class Indicator extends PanelMenu.SystemIndicator {
+var Indicator = GObject.registerClass(
+class Indicator extends PanelMenu.SystemIndicator {
     _init() {
         super._init();
 
index 3c97148d5c8dfd6d8007526f2bc12cd83c1cf2c0..c212e8ecd36cc3229e9b7e6e86bb0dc41110027a 100644 (file)
@@ -221,9 +221,8 @@ Signals.addSignalMethods(AuthRobot.prototype);
 
 /* eof client.js  */
 
-var Indicator = GObject.registerClass({
-    GTypeName: 'Thunderbolt_Indicator'
-}, class Indicator extends PanelMenu.SystemIndicator {
+var Indicator = GObject.registerClass(
+class Indicator extends PanelMenu.SystemIndicator {
     _init() {
         super._init();
 
index 53b48a8da22770b34d9e7cc0f4ac9ac25b5abb78..9109121c4926c39e4fed282b682d6a29f7d71752 100644 (file)
@@ -347,9 +347,8 @@ var VolumeMenu = class extends PopupMenu.PopupMenuSection {
     }
 };
 
-var Indicator = GObject.registerClass({
-    GTypeName: 'Volume_Indicator'
-}, class Indicator extends PanelMenu.SystemIndicator {
+var Indicator = GObject.registerClass(
+class Indicator extends PanelMenu.SystemIndicator {
     _init() {
         super._init();
 
index 9dcc60f40c63fe375643e9352021894f981ffb85..9e1f328eee884401a33eff245ea20f9eb3b352ae 100644 (file)
@@ -14,9 +14,8 @@ var AVATAR_ICON_SIZE = 64;
 // Copyright (C) 2004-2005 James M. Cape <jcape@ignore-your.tv>.
 // Copyright (C) 2008,2009 Red Hat, Inc.
 
-var Avatar = GObject.registerClass({
-    GTypeName: 'UserWidget_Avatar'
-}, class Avatar extends St.Bin {
+var Avatar = GObject.registerClass(
+class Avatar extends St.Bin {
     _init(user, params) {
         let themeContext = St.ThemeContext.get_for_stage(global.stage);
         params = Params.parse(params, { reactive: false,
index dc4c212b32b14c1a982e03c4e67d37262cff69b1..48329e18e1a4c5ff0da95840f41975774aeaa1d7 100644 (file)
@@ -94,7 +94,6 @@ class WindowCloneLayout extends Clutter.LayoutManager {
 });
 
 var WindowClone = GObject.registerClass({
-    GTypeName: 'Workspace_WindowClone',
     Signals: {
         'drag-begin': {},
         'drag-cancelled': {},
index ff23d9e2e710cb8edcd63027e9ad2e1277442f9f..d7cd6396cfe7fabbe37c50e29e34b0a67159bc40 100644 (file)
@@ -44,7 +44,6 @@ class PrimaryActorLayout extends Clutter.FixedLayout {
 });
 
 var WindowClone = GObject.registerClass({
-    GTypeName: 'WorkspaceThumbnail_WindowClone',
     Signals: {
         'drag-begin': {},
         'drag-cancelled': {},